package day9;
import java.util.*;
/**
 * @author oldliu
 * @since 1.0
 */
public class ListDemo {
    public static void main(String[] args) {
        List<Integer> list=new ArrayList<>();
        for(int i=1;i<=5;i++){
            new ListThread(list).start();
        }
    }
}
class ListThread extends  Thread{
    private final List<Integer> list;

    public ListThread(List<Integer> li)
    {
        this.list=li;
    }

    @Override
    public void run() {
        for(int i=1;i<=1000000;i++)
            list.add(i);
    }
}
